#ifndef VECTOR_H
#define VECTOR_H

class Vector
{
public:
    Vector();
    Vector(double x, double y, double z);
    Vector(const Vector &v);
    ~Vector();

    Vector& operator=(const Vector &v);

    Vector& normalize();
    double norm() const;
    double sproject(const Vector &v) const;
    Vector project(const Vector &v) const;
    inline double& operator()(int i) {
        return elements[i];
    };

    inline double operator()(int i) const {
        return elements[i];
    };

private:
    double elements[4];
    void copy(const Vector &v);
};

Vector operator+(const Vector &left, const Vector &right);
Vector operator-(const Vector &left, const Vector &right);
double operator*(const Vector &left, const Vector &right);
Vector operator*(double s, const Vector& v);
Vector operator*(const Vector& v, double s);
Vector operator/(const Vector& v, double s);
Vector operator-(const Vector& v);
Vector vecprod(const Vector &left, const Vector &right);
double cossine(const Vector &left, const Vector &right);
double angle(const Vector &left, const Vector &right);

#endif // VECTOR_H
